#version 300 es
layout(location = 0) in vec4 a_position;
layout(location = 1) in vec4 a_color;
layout(location = 2) in vec2 a_texCoord0;

uniform mat4 u_projTrans;

out vec4 v_color;
out vec2 v_texCoord;
out vec2 v_position2d;
out vec2 v_viewPosition2d;

void main() {
    v_color = a_color;
    v_texCoord = a_texCoord0;
    v_position2d = a_position.xy;
    v_viewPosition2d = ((u_projTrans * a_position).xy + 1.0) * 0.5;
    gl_Position = u_projTrans * a_position;
}
